package polymorphism;

public class Type {
    public static void main(String[] args) {
        Person p = new Person("p", 16);
        Student s = new Student("s", 17, "software technology");
        Teacher t = new Teacher("t", 28, "software engineer");
    
        System.out.println(p instanceof Person);
        System.out.println(s instanceof Person);
        System.out.println(t instanceof Person);
    
        System.out.println(p instanceof Student);
        System.out.println(p instanceof Teacher);
        
        p = t;
        Teacher teacher = (Teacher)p;
        teacher.setPosition("network");
    
        ((Teacher) p).setPosition("asdfjsa");
        
        
    }
}
